package bidgetserver;
import java.io.IOException;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import SmsModule.SmsSender;

import emailModule.emailSender;


public class SMSservlet extends HttpServlet{

	public void doPost(HttpServletRequest req, HttpServletResponse resp)
	throws IOException {

		String CellphoneNumber=req.getParameter("cellNum");

		//String MsgBodyString = "BidGet - new result on \"ipod\"";
		//emailSender.SendEmail(CellphoneNumber+"@spikkosms.com","Bidget", "auto alert");

		
		String userBid="100000000";
		String timeID="555";
		String timeToAlertStr2 = "10";
		//SMS sending to client:
		if(!(CellphoneNumber.equals(null)) && !(CellphoneNumber.equals(""))){
    		String SmsContent;
    		if( userBid.equals("100000000")){
        		SmsContent="BidGet: Auction "+timeID+" about to end in "+timeToAlertStr2+" min. Your bid is NOT on the lead!";
        		SmsSender.SendSMS(SmsContent, CellphoneNumber);
    		}
		}
	}

}
